<template>
  <div class="bz-flex bz-flex bz-flex-w-w bz-flex-jc-sb">
    <div class="bz-w-48" v-for="(item,index) in goodsList" :key="index" @click="toItemPath(item.id)">
      <div><img class="bz-w-100" :src="item.img"/></div>
      <div>{{ item.name }}</div>
      <div>{{ item.price }}</div>
      <div>{{ item.desc }}</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "GoodsItem",
    data() {
      return {
        goodsList: [
          {id:1,img:'/img/goodsImg.jpg',name:'儿童小学生一次性3D口罩三层防护',price:'￥108.00',desc:'送108幸运星'},
          {id:2,img:'/img/goodsImg.jpg',name:'防水防雾游泳眼镜男女时尚款',price:'￥10.00',desc:'送108幸运星'},
          {id:3,img:'/img/goodsImg.jpg',name:'海亿醇然心动薄荷糖50g（约30个）',price:'￥18.00',desc:'送108幸运星'},
          {id:4,img:'/img/goodsImg.jpg',name:'防水防雾游泳眼镜男女时尚款',price:'￥1108.00',desc:'送108幸运星'},
          {id:5,img:'/img/goodsImg.jpg',name:'海亿醇然心动薄荷糖50g（约30个）',price:'￥122.00',desc:'送108幸运星'},
          {id:6,img:'/img/goodsImg.jpg',name:'防水防雾游泳眼镜男女时尚款',price:'￥132.00',desc:'送108幸运星'},
          {id:7,img:'/img/goodsImg.jpg',name:'儿童小学生一次性3D口罩三层防护',price:'￥144.00',desc:'送108幸运星'},
          {id:8,img:'/img/goodsImg.jpg',name:'防水防雾游泳眼镜男女时尚款',price:'￥156.00',desc:'送108幸运星'},
          {id:9,img:'/img/goodsImg.jpg',name:'儿童小学生一次性3D口罩三层防护',price:'￥178.00',desc:'送108幸运星'},
          {id:10,img:'/img/goodsImg.jpg',name:'防水防雾游泳眼镜男女时尚款',price:'￥166.00',desc:'送108幸运星'},
          {id:11,img:'/img/goodsImg.jpg',name:'儿童小学生一次性3D口罩三层防护',price:'￥168.00',desc:'送108幸运星'},
        ]
      };
    },
    methods:{
      toItemPath(id){
        this.$emit('toItemPath',id);
      }
    }
  }
</script>

<style scoped>

</style>
